<template>
  <div id="app">
    <keep-alive>
      <router-view v-if="meta.keepAlive"></router-view>
    </keep-alive>
    <router-view v-if="!meta.keepAlive"/>
  </div>
</template>
<script>
export default {
  computed: {
    meta() {
      return this.$route.meta
    }
  },
  created() {
    window.connectWebViewJavascriptBridge(function (bridge) {
        bridge.init();
        window.WebViewJavascriptBridge.callHandler(
          'getUserInfo'
          , { }//如无参数可以传{}
          , function (responseData) {
            // console.log(responseData);
            
            window.localStorage.setItem('user', responseData)
          }
        );
    })
    
    // 存一下用户数据
    // window.localStorage.setItem('user', JSON.stringify({
    //   // 以下从用户登录信息里获取
    //   groupId: 33271,
    //   groupName: "春江中队",
    //   userId: 5525,
    //   userName: "fu4执法队员(春江中队)",
    //   parentGroupId: 33239,
    //   parentGroupName: "富阳区城管局",
    //   orgLevel: 4
    // }))
  }
}
</script>
<style scoped>
#app{
  height: 100%;
}
</style>
